package com.ruoyi.web.controller.WebAPI;

import com.github.pagehelper.PageHelper;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.bean.validators.plugins.schema.MinMaxAnnotationPlugin;


import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;

@RestController
@RequestMapping("/business/api")
public class test {


    /**
     * 获取用户列表
     */
    @PreAuthorize("@ss.hasPermi('system:user:list')")
    @GetMapping("/list")
    public TableDataInfo list(SysUser user)
    {
        PageHelper.startPage(1, 10);
        //List<SysUser> list = userService.selectUserList(user);
        //return getDataTable(list);
        return null;
    }

    //public static void main(String[] args) {
    //    try {
    //        HttpClient client = HttpClient.newHttpClient();
    //        String url = "http://localhost:8080/predict"; // 假设你的服务地址和端口
    //        String input = "your input text";
    //        String encodedInput = URLEncoder.encode(input, StandardCharsets.UTF_8);
    //        String requestUrl = url + "?input=" + encodedInput;
    //
    //        HttpRequest request = HttpRequest.newBuilder()
    //                .uri(URI.create(requestUrl))
    //                .GET()
    //                .build();
    //
    //        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
    //        System.out.println("Response: " + response.body());
    //    }catch (Exception err){
    //        err.printStackTrace();
    //    }
    //
    //}

}
